﻿using System.Collections.Generic;
using System.Web.UI;

namespace mAdcOW.SharePoint.TaxonomyFilter
{
    internal static class ControlHelper
    {
        public static IEnumerable<Control> GetAll(this Control parent)
        {
            foreach (Control control in parent.Controls)
            {
                yield return control;
                foreach (Control descendant in control.GetAll())
                {
                    yield return descendant;
                }
            }
        }
    }
}